home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / taropyon / silib / prg / sdkfs / sdkfs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-16  |  2.7 KB  |  87 lines

  1. /*************************************************************************
  2. *    ファイルセレクタ構造体
  3. *************************************************************************/
  4.  
  5. #ifndef    _SDKFS_H
  6. #define    _SDKFS_H
  7.  
  8. #include    <dos.h>
  9. #include    <sidefs.h>
  10. #include    <siev.h>
  11. #include    <sisbar.h>
  12. #include    <SDK/blkdlg.h>
  13.  
  14. #define    _SDKFS_VER    "2.01b"
  15.  
  16. typedef    struct _fndat_t
  17. {
  18.     struct _fndat_t    *next;
  19.     struct    find_t    buf;    /* look <dos.h>    */
  20.     int                no;
  21.     int                flag;
  22.     int                mark;
  23. } FNDAT_T;
  24.  
  25. typedef    struct
  26. {
  27.     unsigned    att;                /* 属性                                */
  28.     unsigned    stt;                /* ステータス                        */
  29.     int            err;                /* エラー                            */
  30.  
  31.     BLKDLG_T    *dlg;                /* ダイアログ用ワーク                */
  32.     FRAME_T        fr;
  33.     FRAME_T        frDrv;                /* ドライブセレクタ枠                */
  34.     FRAME_T        frFl;                /* ファイル表示枠                    */
  35.     EV_T        *ev;                /* イベント用                        */
  36.     EV_T        *evDrv;                /* ドライブ選択用イベント            */
  37.     EV_T        *evFn;                /* ファイル名                        */
  38.     char        *title;                /* タイトル                            */
  39.     SB_T        *sb;                /* スクロールバー用                    */
  40.  
  41.     char        buf[256];            /* 入力ファイル名                    */
  42.  
  43.     int            drv;                /* ドライブ [A:0 [B:1                */
  44.     char        whare[256];            /* ディレクトリ                        */
  45.     char        *wild;                /* ワイルドカード                    */
  46.     int            sort;                /* ソートタイプ                        */
  47.  
  48.     int            numFn;                /* ファイル数(ディイレクリも含む)    */
  49.     FNDAT_T        *fnTop;                /* ディレクトリバッファ先頭            */
  50.     int            numMat;                /* マッチしたファイル数                */
  51.     FNDAT_T        **fnMat;            /* マッチしたファイル名                */
  52.     int            posDspTop;            /* 表示するファイル名の先頭            */
  53.     int            posMark;
  54. } FILESEL_T;
  55.  
  56. #define    FSCD_CRTSAVE    (0x20)    /* カレントディレクトリ状態保存    */
  57.  
  58. extern FILESEL_T   *FileSel_open(void);
  59. extern void            FileSel_close( FILESEL_T *fs );
  60. extern int            FileSel_start( FILESEL_T *fs );
  61. extern int            FileSel_setTitle( FILESEL_T *fs, CONST char *form, ... );
  62. extern int            FileSel_setWild( FILESEL_T *fs, CONST char *wild );
  63. extern char           *FileSel_getFn( FILESEL_T *fs );
  64.  
  65. #define    FSATT_DIR    (0x10)
  66. #define    FSATT_VOL    (0x08)
  67. #define    FSATT_SYS    (0x04)
  68. #define    FSATT_ARC    (0x02)
  69. #define    FSATT_RO    (0x01)
  70.  
  71. #define    FSSORT_OFF        (0x00)        /* ソートなし        */
  72. #define    FSSORT_FILE        (0x01)        /* ファイル名        */
  73. #define    FSSORT_SUB        (0x02)        /* 拡張子            */
  74. #define    FSSORT_DATE        (0x03)        /* 日付                */
  75. #define    FSSORT_SIZE        (0x04)        /* サイズ            */
  76. #define    FSSORT_RVS        (0x80)        /* 昇順/降順        */
  77. #define    FSSORT_DIRTOP    (0x00)        /* ディレクトリ先頭    */
  78. #define    FSSORT_DIRLAST    (0x20)        /* ディレクトリ最後    */
  79. #define    FSSORT_DIROFF    (0x40)        /* ディレクトリ        */
  80. #define    FSSORT_DIRBIT    (FSSORT_DIRLAST|FSSORT_DIROFF)
  81.  
  82. #define    FS_ISSORT_DIRTOP(_sort)        (((_sort)&FSSORT_DIRBIT) == FSSORT_DIRTOP)
  83. #define    FS_ISSORT_DIRLAST(_sort)    (((_sort)&FSSORT_DIRBIT) == FSSORT_DIRLAST)
  84. #define    FS_ISSORT_DIROFF(_sort)        (((_sort)&FSSORT_DIRBIT) == FSSORT_DIROFF)
  85.  
  86. #endif
  87.